package org.zhq.box;

import org.zhq.core.Packet;
import org.zhq.core.ReceivePacket;

import java.io.OutputStream;

/**
 * 直流接收包
 *
 * @author zhengquan
 * @date 2019/2/25
 */
public class StreamDirectReceivePacket extends ReceivePacket<OutputStream, OutputStream> {
    private OutputStream outputStream;

    public StreamDirectReceivePacket(long len, OutputStream outputStream) {
        super(len);
        this.outputStream = outputStream;
    }

    @Override
    protected OutputStream buildEntity(OutputStream stream) {
        return outputStream;
    }

    @Override
    protected OutputStream createStream() {
        return outputStream;
    }

    @Override
    public byte type() {
        return Packet.TYPE_STREAM_DIRECT;
    }
}
